package com.Rubbish;

import java.util.List;

public class Rubbish {
    int x;
    int y;

    public Rubbish(int x, int y) {
        this.x = x;
        this.y = y;
    }
    public boolean bIsStation(List<Rubbish> list){
        int num = 0;
        for (int i = 0; i < list.size(); i++) {
            if(Math.sqrt(Math.pow(list.get(i).x - this.x,2) + Math.pow(list.get(i).y - this.y,2)) <= 1){
                num++;
            }
        }
        if(num == 5){
            return true;
        }
        return false;
    }

    @Override
    public String toString() {
        return "Rubbish{" +
                "x=" + x +
                ", y=" + y +
                '}';
    }
}
